package br.com.fogas.webservice.parser;

import br.com.fogas.utils.FogasUtility;
import br.com.fogas.utils.exception.ParseXmlException;

public class BaseParser {

	private String responseXML;
	
	private String requestXML;
	
	public String getRequestXML() throws ParseXmlException {
		this.requestXML = getRequestXml();
		return requestXML;
	}
	
	private String getRequestXml() throws ParseXmlException {
		String parseXML = FogasUtility.xml.parseXML(this);
		parseXML = parseXML.replaceAll("xmlns:xmlns", "xmlns");
		parseXML = parseXML.replaceAll("Header", "soapenv:Header");
		parseXML = parseXML.replaceAll("Body", "soapenv:Body");
		return parseXML;
	}
	
	public String getResponseXML() {
		return responseXML;
	}
	
	public void setResponseXML(String responseXML) {
		this.responseXML =  responseXML;
	}
}